// users.route.js
const Router = require("koa-router");

const { getContentByType,addContent,upload,update,remove} = require("../controller/content.controller");

const { auth } = require('../middleware/auth.middleware');
const { contentVerify } = require('../middleware/content.middleware');
const router = new Router({ prefix: "/api/contents" });


//获取内容信息
router.get("/contentList", getContentByType);
// 添加内容
router.post("/addContent", contentVerify, addContent);
// 上传图片
router.post("/upload", upload);
// 更新内容
router.put('/:id', update)
router.post('/:id/off', remove)
module.exports = router;